<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class WxRegisterRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required',
            'mobile' => 'required|digits:11',
            'idcard' => 'required',
            'gender' => 'required',
            'birthday' => 'required',
        ];
    }


    public function messages()
    {
        return [
            'name.required' => '姓名不能为空',
            'mobile.required' => '手机号码不能为空',
            'mobile.digits' => '手机号码格式不正确',
            'idcard.required' => '身份证号码不能为空',
            'gender.required' => '请选择性别',
            'birthday.required' => '请填写出生日期',
        ];
    }
}
